<!-- Mitch Allen -->
<%@ page import="instructor.sample.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>

<% 
   String today = null;
   Today t = new Today();
   today = t.getToday();
   request.setAttribute("picture","Customer");
   request.setAttribute("title", "Customer Home"); 
   request.setAttribute("header", "Welcome " + 
   		session.getAttribute("firstname") + " " + 
   		session.getAttribute("lastname") + " from " + 
   		session.getAttribute("customername") + " : Today is " + today); 
 %>
 <%@ include file="customerheader.jsp"%><TD width="850" vAlign="top"> 
<br /><h2>Create a New Service Order</h2><br />

<%  
Customer c = new Customer();
int customerid = Integer.parseInt(request.getParameter("customerid"));
c.setCustomerData(customerid);
%>

 
<SCRIPT LANGUAGE="JavaScript"> 
function PM() {
if (form1.servicetype.value == "5") {
location.replace("newso.jsp?equipmentid="+form1.equipmentid.value+
				"&&pm=true"+"&&servicetype="+form1.servicetype.value+
				"&&priority="+form1.priority.value+"&&name="+
				form1.name.value+"&&phone="+form1.phone.value+
				"&&email="+form1.email.value);
}
else {
location.replace("newso.jsp?equipmentid="+form1.equipmentid.value+
				"&&pm=false"+"&&servicetype="+form1.servicetype.value+
				"&&priority="+form1.priority.value+"&&name="+
				form1.name.value+"&&phone="+form1.phone.value+
				"&&email="+form1.email.value);
}
}
</script>


<!-- --------------------------------------------Form-------------------------------------------------------------------------- -->

  <form name=form1 action=createso.jsp method=post >
  
  			<table width=100% border=0 cellpadding=4 cellspacing=3>
 			<tr>
 				<td>Customer Name: </td><td><input type = text name = customername value='<%=c.getCustomerName()%>' Readonly></td>
 				<td>Date:</td><td>02/01/2009</td>		
 			</tr>
 			 <tr>
 			 	<td>Equipment Number: </td><td><input type = text name = equpimentnumber value='<%=c.getCustomerEquipmentNumber()%>' Readonly></td>
 			 	<td>Product:</td><td><input type = text name = equpimentnumber value='<%=c.getProductName()%>' Readonly></td>
 			 </tr>
 			 <tr>
    			<td>Priority:</td>
    			<td colspan = 3><select name="priority">
			  		<option value=1>Patient on Table</option>
			  		<option value=2>High</option>
			  		<option value=3>Medium</option>
			  		<option value=4>Low</option>
    				</select>
    				&nbsp;<FONT color=#ff0066>*</font></td>
    		</tr>
 			<tr>
		    	<td>Service Type:</td>
				<td><select name="servicetype" onChange="PM()">
					<option value=1>Poor Image</option>
			  		<option value=2>Power Supply</option>
			  		<option value=3>Connectivity</option>
			  		<option value=4>Overheating</option>
			  		<option value=5 Selected>Preventative Maintenance</option>
					<option value=6>Noise</option>
			  		<option value=7>Repeat Issue</option>
			  		<option value=8>Other</option>
			  		<option value=9>Forgot Password</option>
		  			</select>
		  			&nbsp;<FONT color=#ff0066>*</font></td>
    			<td>Preventive Maintenance Type:</td><td><select name="pm">
    				<option value=1>Tube Replacement</option>
  					<option value=2>Coldhead Replacement</option>
  					<option value=3>Magnet Quench Recovery</option>
  					<option value=4>Image Intensifier Replacement</option>
  					</select>
  			</tr>
 			<tr>
 				<td>Contact Name: </td><td><input type = text name = contactname value='<%=c.getContactName()%>'>&nbsp;<FONT color=#ff0066>*</font></td>
  				<td>Contact Phone: </td><td><input type = text name = contactphone value='<%=c.getContactPhone()%>'>&nbsp;<FONT color=#ff0066>*</font></td>
 			</tr>
 			<tr>
 				<td>Contact Email: </td><td colspan = 3><input type = text name = contactemail value='<%=c.getContactEmail()%>'>&nbsp;<FONT color=#ff0066>*</font></td>
 			</tr>
 			
 </table>
 
<br /><h3>Problem Description:</h3>
    <p><textarea name="problemdescription" rows=5 cols=100></textarea>
    </p>
	<input type=submit value="Create New Service Order" name=submit>
	<input type=button name=reset Value=Reset>
	<input type=button name=back Value=Back>
 <%
 c.closeConnection();
 %>
<hr><br />
<br/>
</form>
  
  
  
  
  
  
  
  
  